package com.yong.sbd.biz.mp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yong.sbd.biz.mp.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户Mapper接口
 *
 * @author Kang Yong
 * @date 2025/10/27
 * @since 1.0.0
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    
    /**
     * 根据用户ID查询用户及其角色信息
     *
     * @param userId 用户ID
     * @return {@link SysUser}
     */
    SysUser selectUserWithRoles(@Param("userId") Long userId);
    
    /**
     * 查询所有用户及其角色信息
     *
     * @return {@link List<SysUser>}
     */
    List<SysUser> selectUsersWithRoles();
}